UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'resPCKV4Ev6Hyvjhi3MmR9kHrDRh3yNze16GW5jyraI='
WHERE
key_id = 'ef7624cc80a309a7a40e304c0b4ef9e022556a3e54101c9998c4f278b33eef2d'
AND (
token = 'resPCKV4Ev6Hyvjhi3MmR9kHrDRh3yNze16GW5jyraI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)