UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '88SJiX0cowQtu9PjHclREypZTZBHad2lTj74EKKdfxg='
WHERE
key_id = 'fe995df72fd08d0d37574a522eaae387c80f8c1b2a123777c0b2bd0d9ea79b26'
AND (
token = '88SJiX0cowQtu9PjHclREypZTZBHad2lTj74EKKdfxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)