UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7t0XUePs83DdN8NfL3Atg4Th70sGRgh/HS7G79SLf7U='
WHERE
key_id = 'eb2320992980b35eeb7f619104b6fee62f571ccf0485f06234d8b08d9ae06571'
AND (
token = '7t0XUePs83DdN8NfL3Atg4Th70sGRgh/HS7G79SLf7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)