UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UGoQPFXQoJt0zHX+MYUvTj6mP2La5tzQ5oIo1wmrBWw=' 
WHERE 
  key_id = '3a0f18c5566708ecf2087cba24ba360ae6d9fdeb95e51c23dfc1e6a25e6aa6a0' 
  AND (
    token = 'UGoQPFXQoJt0zHX+MYUvTj6mP2La5tzQ5oIo1wmrBWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020