UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fNH/YD5TewwMiMflv2YL41g8eqhlT4XKoiz8nxaa3F8='
WHERE
key_id = '8d6686dcd7bac25cc638a00ebde2b15ae52cd5f8b9002afa33f41eba8e90bd4f'
AND (
token = 'fNH/YD5TewwMiMflv2YL41g8eqhlT4XKoiz8nxaa3F8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)