UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ylqO/pDiNHtxOlsbYCk3He0Iv9nHA5gDbcyKBk9XqIA='
WHERE
key_id = '4b74ad208e59abe17e2a1504b1396066566505e27be6bf1d32cda01657780807'
AND (
token = 'ylqO/pDiNHtxOlsbYCk3He0Iv9nHA5gDbcyKBk9XqIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)