UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Ui8z9MzI4yt2Fl915zuZI2iOjHtLF3YbYcp7fxODA4='
WHERE
key_id = '8caccba2f6bdee0400533d5f7fef567045d2f17cbf45b9b2f5a2b81e6fa0bb6f'
AND (
token = '4Ui8z9MzI4yt2Fl915zuZI2iOjHtLF3YbYcp7fxODA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)