UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UrPM/tPRzot5j7c/x3Yw6oSbVT5JjIZulfZlC3EWRWU='
WHERE
key_id = 'bcefa43e365f037309ce9e4954ee12ed2b03a9a1122ac9583d62418db8475acd'
AND (
token = 'UrPM/tPRzot5j7c/x3Yw6oSbVT5JjIZulfZlC3EWRWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)