UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oAJTUsOZzBGwVH7d4AgZ6WxK5aLZSiBZ7IgelWiVsIk='
WHERE
key_id = '3aec6132d94a0afaf19fe4af1851437712b747831cff51444835e9bbfef205c6'
AND (
token = 'oAJTUsOZzBGwVH7d4AgZ6WxK5aLZSiBZ7IgelWiVsIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)