UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7C3l7S8jHKhGAXwfL1nOIeJHn8q6l1dMz5ZpLnMdyr0='
WHERE
key_id = '7958cb8d11b757f74cf220fa5697395dbf95a853b804bd232c1d7b3409835498'
AND (
token = '7C3l7S8jHKhGAXwfL1nOIeJHn8q6l1dMz5ZpLnMdyr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)