UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uz19fCKPtZDWRlTi1XHo7evNGkcXCraRI+aHJf0uqU0='
WHERE
key_id = 'd4a70915da57bae141e6778dfe088c35e8495dd4faa1a93ec0d8acea2b6d2289'
AND (
token = 'Uz19fCKPtZDWRlTi1XHo7evNGkcXCraRI+aHJf0uqU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)