UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/5LDmjilp210UUvniN7g3D2YLXDI1GqUwaK3VjqA3ok='
WHERE
key_id = '41ee570eff97846131409dfaf906c3fb157b1908f14ceb5372ea1aeb9487f7fc'
AND (
token = '/5LDmjilp210UUvniN7g3D2YLXDI1GqUwaK3VjqA3ok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)