UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q1H+HU8BBGNYPJ+bPh1/JfrUOTnH7+3KwKaxONR/f1w=' 
WHERE 
  key_id = '3a0ea47a2eae1af424077cdd5ce99f9db099859370405d3c3ee239a4a1be92db' 
  AND (
    token = 'q1H+HU8BBGNYPJ+bPh1/JfrUOTnH7+3KwKaxONR/f1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031