UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rPan+iBwHyfC1UktG9m6Got0mSIZHCaoQWcBIfjgpQI='
WHERE
key_id = 'abb827502e07f4768898cdb054a83928afdea6b2f38e71c49c1fd3e02491dfe3'
AND (
token = 'rPan+iBwHyfC1UktG9m6Got0mSIZHCaoQWcBIfjgpQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)