UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RUpsLd5ChIyGmcEoGfKb9XygL9LY6/m9nAqMePlypDI='
WHERE
key_id = 'f12621f5a04f86be24bf366e7875f454f26846c93acfd72182a2d25675f12904'
AND (
token = 'RUpsLd5ChIyGmcEoGfKb9XygL9LY6/m9nAqMePlypDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)