UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z/OMu8WwUT+hbrC/4eDw5H1zbXHq/IOjlZd02MAGqpI=' 
WHERE 
  key_id = 'dc8cdb84df2e8be2d92a5b857c0e353c2610e56db0c0bc5510d6bcf7c9566a92' 
  AND (
    token = 'z/OMu8WwUT+hbrC/4eDw5H1zbXHq/IOjlZd02MAGqpI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022