UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1xQjhR8TC1Dx6GBGgO9Endv+W8btCZRevI6Q8nI9CXs=' 
WHERE 
  key_id = 'b34571d2cee53d042e0e167440f8f9ee4ff28f2e3097ffdc1f6c6569eac0e1e2' 
  AND (
    token = '1xQjhR8TC1Dx6GBGgO9Endv+W8btCZRevI6Q8nI9CXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058