UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lC5XZ5CiLGFAHKbbFo7MFP/QcgRckWLWYwpqiETSJuM='
WHERE
key_id = 'e1f3e78d0051a826710087dacac48bca0120dc875055715762e0a74fbac5e8e0'
AND (
token = 'lC5XZ5CiLGFAHKbbFo7MFP/QcgRckWLWYwpqiETSJuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)