UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YEkDdUiCHs/ztCO9sREa9si1O4YEG0xe1MCG3rl2wPc='
WHERE
key_id = '1c6017dabc781be95c9909d1eca3e97ab86dbef4aaad9035a97af4b91bd479df'
AND (
token = 'YEkDdUiCHs/ztCO9sREa9si1O4YEG0xe1MCG3rl2wPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)