UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ctxh7GLF4UyDfmuoZZrwA4OSILPz7fzS3JA6hjTMQw=' 
WHERE 
  key_id = 'c696167bfac4255438ab7820e15200c38b8b79e9cb64d7a95f86bf0e3fb9ac44' 
  AND (
    token = '9ctxh7GLF4UyDfmuoZZrwA4OSILPz7fzS3JA6hjTMQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053