UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2SStRyYqEYLfxSBckCgueH9Y/wtrRy4k7XdeNnjm3GU='
WHERE
key_id = 'aa6f3bd1cc82699bfd53fd80028130d7821c5614fb47992f4b02ef926a509211'
AND (
token = '2SStRyYqEYLfxSBckCgueH9Y/wtrRy4k7XdeNnjm3GU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)