UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LS/MuS7U6dkNHQUnwXeOfBxhKCR91//i4GQtPCuFykg='
WHERE
key_id = '1edd8fb93a32bd512275df925c07c2e6b3a1f745aae312ec17258669f1c41b9f'
AND (
token = 'LS/MuS7U6dkNHQUnwXeOfBxhKCR91//i4GQtPCuFykg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)