UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2f0NmK4qtjc4pyYXTQ92ogjjpzCViTLfT3aiAqWfgzg='
WHERE
key_id = '510b2d1088cbe7c7525cf63379b6ed0e2ee05890afed8491c9de45f6f30c6f80'
AND (
token = '2f0NmK4qtjc4pyYXTQ92ogjjpzCViTLfT3aiAqWfgzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)