UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o/xXlFhyBO6NcKhllAGbZEpJFAuXbiIUWwLCJmH+Jok=' 
WHERE 
  key_id = '88f2abd391ca52777cabd2e375052bcb1f5862887b66b509d060a59d08965d8a' 
  AND (
    token = 'o/xXlFhyBO6NcKhllAGbZEpJFAuXbiIUWwLCJmH+Jok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039