UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4RHZ5Gn8xz3smxvJfm1K9fVF+5IDvzzn5Pe8KLDylnI=' 
WHERE 
  key_id = '7bbc182e5d203a0be51aaf4c764c80a1811584843562c08c092613546e55d6ec' 
  AND (
    token = '4RHZ5Gn8xz3smxvJfm1K9fVF+5IDvzzn5Pe8KLDylnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045