UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ngt7Zj9rzClrUN7cF+5UpohrdcKazzQ+cY4q3eSFmLI=' 
WHERE 
  key_id = 'abf1109ae3237404b77464862126be50cfec0da0285b8d2c2d5edbfa65fea72b' 
  AND (
    token = 'ngt7Zj9rzClrUN7cF+5UpohrdcKazzQ+cY4q3eSFmLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032