UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xy8pf5GL+PMam2youVvYto4m2/3OzU3Ap5gtd5AtFpo='
WHERE
key_id = '9e695b49f02e097d0d1592ed3bb8ae1213566b6dec9da1f2f00d56a0192f776d'
AND (
token = 'xy8pf5GL+PMam2youVvYto4m2/3OzU3Ap5gtd5AtFpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)