UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2LP7Bowp/E17o6VWm5uzJo4sRLY8GJPRPZix/tcUbq4=' 
WHERE 
  key_id = '72c689a37ce44599f2cc9c91f1fa29dd939e792e0d409a8fdf1b42fccf4f26b8' 
  AND (
    token = '2LP7Bowp/E17o6VWm5uzJo4sRLY8GJPRPZix/tcUbq4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026