UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CJQiCyEzSD02rz97ruhhEjAdVtRKvYlbhf1rwO/l/VY=' 
WHERE 
  key_id = 'df06611e774810fb7e14be4815cad77f07afb6d6f46091ee8b1f5aaeea86c0ef' 
  AND (
    token = 'CJQiCyEzSD02rz97ruhhEjAdVtRKvYlbhf1rwO/l/VY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038