UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7rcJJqZ01xQV2FFe7gHQtYG+KaG/Ocy8SaB0KAHUOvk=' 
WHERE 
  key_id = '8b94b897ee93e932a0b713bedab4e70fdea0132c41bbae638ff9cb3e23bc1fc2' 
  AND (
    token = '7rcJJqZ01xQV2FFe7gHQtYG+KaG/Ocy8SaB0KAHUOvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024